﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Csla;
using BizControl.Library.Security;
using System.ComponentModel.Composition;
using BizControl.Presentation.Shell.ViewModels;

namespace BizControl.Presentation.Shell
{
  public sealed partial class ModelSelector : Window
  {
    public ModelSelector()
    {
      InitializeComponent();
      DataContext = new ModelSelectorViewModel();
    }

    private bool _result;

    public bool Result
    {
      get { return _result; }
      set { _result = value; }
    }

    void EnterButton(object sender, EventArgs e)
    {
      _result = true;
      this.Close();
    }

    void CancelButton(object sender, EventArgs e)
    {
      _result = false;
      this.Close();
    }

    void SaveButton(object sender, EventArgs e)
    {
      AddingModelStackPanel.Visibility = System.Windows.Visibility.Collapsed;
    }

    void AddModelButton(object sender, RoutedEventArgs e)
    {
      AddingModelStackPanel.Visibility = System.Windows.Visibility.Visible;
      this.ModelNameTextBox.Focus();
    }
  }
}
